<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>

<style>
    @-webkit-keyframes bouncedelay {
        0%, 80%, 100% {
            -webkit-transform: scale(0.0)
        }
        40% {
            -webkit-transform: scale(1.0)
        }
    }

    @keyframes bouncedelay {
        0%, 80%, 100% {
            transform: scale(0.0);
            -webkit-transform: scale(0.0);
        }
        40% {
            transform: scale(1.0);
            -webkit-transform: scale(1.0);
        }
    }

    .autocomplete-suggestions {
        border: 1px solid #999;
        background: #FFF;
        overflow: auto;
    }

    .autocomplete-suggestion {
        padding: 2px 5px;
        white-space: nowrap;
        overflow: hidden;
    }

    .autocomplete-selected {
        background: #F0F0F0;
    }

    .autocomplete-suggestions strong {
        font-weight: normal;
        color: #3399FF;
    }

    @-moz-document url-prefix() {
        fieldset {
            display: table-cell;
        }
    }

    .custom-btn {
        width: 147px;
        height: 88px;
        /*box-shadow: 1px 1px 1px #888888;*/
        text-align: center;
        display: inline-block;
        margin-top: 3px;
        margin-right: 3px;
    }

    .custom-btn-num-text {
        color: white;
        font-size: 20px;
        font-family: fantasy;
        margin-top: 39px;
    }

    .my-btn {
        width: 147px;
        height: 88px;
        background-color: green;
        position: relative;
        display: inline-block;
    }

    .head-btn {
        position: absolute;
        font-size: 16px;
        top: 10px;
        left: 42px;
        color: white;
    }

    .foot-btn {
        bottom: 0px;
        width: 100%;
        height: 19px;
        background: rgba(45, 32, 32, 0.2);
        position: absolute;

    }

    .detail-btn {
        font-size: 12px;
        position: absolute;
        top: 2px;
        left: 6px;
        color: white;
    }

    .detail-click {
        position: absolute;
        right: 6px;
        top: 1px;
        color: white;
    }

    .body-btn {
        position: absolute;
        color: white;
        font-size: 20px;
        font-family: fantasy;
        text-align: center;
        top: 38px;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;

    }
</style>

<title>主页 - </title>

<!-- ajax layout which only needs content area -->
<div class="page-header">
    <h1>
        <shiro:hasPermission name="BIGSCCREEN">
            <a href="${contextPath}/page/bigScreen">切换大屏</a>
        </shiro:hasPermission>
        <shiro:lacksPermission name="BIGSCCREEN">
            主页
        </shiro:lacksPermission>
        <small>
            <i class="ace-icon fa fa-angle-double-right"></i>
            美好的体验从这里开始
        </small>
    </h1>
</div>
<!-- /.page-header -->

<div class="row" id="app">
    <div class="col-xs-12">
        <!-- PAGE CONTENT BEGINS -->
        <%--<div class="alert alert-block alert-success">
            <button type="button" class="close" data-dismiss="alert">
                <i class="ace-icon fa fa-times"></i>
            </button>

            <i class="ace-icon fa fa-check green"></i>

            欢迎使用
            <strong class="green">
                -烟草对帐平台
                <small>(v1.0)</small>
            </strong>,
            更好的工作流程，更好的用户体验！
        </div>--%>
        <shiro:hasPermission name="SYNTHESIZE:ROOT">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div class="widget-box transparent">
                        <div class="widget-header widget-header-flat">
                            <h4 class="widget-title lighter">
                                <i class="ace-icon fa fa-adjust"></i>
                                综合分析
                            </h4>

                            <div class="widget-toolbar">
                                <a href="#" data-action="collapse">
                                    <i class="ace-icon fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>

                        <div class="widget-body">
                            <div class="widget-main padding-4">
                                <form class="form-inline" name="myForm" style="margin-bottom:20px;margin-top: 10px;">
                                    <shiro:hasPermission name="CLOUDERPORDERSPLADMINORDER:STATISTICS">
                                        <div class="form-group">
                                            <input id="cityNameInput" onfocus="this.value=''" class="form-control input-sm" type="text"
                                                   placeholder="市局名称">
                                        </div>
                                        <div class="form-group">
                                            <input id="quXianNameInput" onfocus="this.value=''" class="form-control input-sm" type="text"
                                                   placeholder="区县名称">
                                        </div>
                                    </shiro:hasPermission>
                                    <shiro:lacksPermission name="CLOUDERPORDERSPLEMPORDER:STATISTICS">
                                        <shiro:lacksPermission name="CLOUDERPORDERSPLCHANNELORDER:STATISTICS">
                                            <div class="form-group">
                                                <input id="channelNameInput" onfocus="this.value=''" class="form-control input-sm" type="text"
                                                       placeholder="渠道名称">
                                            </div>
                                        </shiro:lacksPermission>
                                        <div class="form-group">
                                            <input id="empNameInput" onfocus="this.value=''" class="form-control input-sm" type="text"
                                                   placeholder="客户经理名称">
                                        </div>
                                    </shiro:lacksPermission>

                                    <div class="form-group hide">
                                        <input id="beginTimeInput" class="form-control input-sm" type="text"
                                               placeholder="开始时间">
                                    </div>
                                    <div class="form-group">
                                        <input id="endTimeInput" class="form-control input-sm" type="text"
                                               placeholder="截止时间">
                                    </div>
                                    <button type="button" class="btn btn-success btn-sm" @click="selectData(1)"
                                            title="">查询
                                    </button>
                                </form>

                                <h5 class="widget-title lighter">
                                    <i class="ace-icon glyphicon glyphicon-user"></i>
                                    网上配货
                                </h5>
                                <div class="row" style="margin-bottom:20px;margin-left: 26px;">
                                    <shiro:hasPermission name="STOCK:STATISTICS">
                                        <a class="my-btn" href="${contextPath}/page/custanalyze" target="_blank"
                                           style="background: rgba(110, 176, 225, 1.0);">
                                            <div class="head-btn">客户库存</div>
                                            <div class="body-btn"><i class="ace-icon glyphicon glyphicon-user"></i>
                                            </div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
        <i class="glyphicon glyphicon-circle-arrow-right"></i>
        </span>
                                            </div>
                                        </a>
                                        <a class="my-btn" href="${contextPath}/page/productanalyze" target="_blank"
                                           style="background: rgba(39, 168, 226, 1.0);">
                                            <div class="head-btn">商品库存</div>
                                            <div class="body-btn"><i class="ace-icon glyphicon glyphicon-tag"></i></div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
        <i class="glyphicon glyphicon-circle-arrow-right"></i>
        </span>
                                            </div>
                                        </a>
                                    </shiro:hasPermission>
                                    <shiro:hasPermission name="ORDER_AOG_LIST:STATISTICS">
                                        <a class="my-btn" href="${contextPath}/shop/toAOGList" target="_blank"
                                           style="background: rgba(39, 118, 126, 1.0);">
                                            <div class="head-btn">订单配送</div>
                                            <div class="body-btn"><i class="ace-icon glyphicon glyphicon-road"></i>
                                            </div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                    </shiro:hasPermission>
                                    <shiro:hasPermission name="ORDER_AOG_STATISTICSLIST:STATISTICS">
                                        <a class="my-btn" href="${contextPath}/shop/toAOGStatisticsList" target="_blank"
                                           style="background: rgb(56, 181, 193);">
                                            <div class="head-btn">配送统计</div>
                                            <div class="body-btn"><i class="ace-icon glyphicon glyphicon-indent-left"></i>
                                            </div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                    </shiro:hasPermission>
                                    <a class="my-btn"
                                            <shiro:hasPermission name="CLOUDERPCLIENTELETOBACCO:VIEW">
                                                href="${contextPath}/sys/user/home#page/clouderpClienteleTobacco"
                                            </shiro:hasPermission>
                                       style="background: rgba(214, 79, 129, 1.0);">
                                        <div class="head-btn">注册总数</div>
                                        <div class="body-btn">{{formatNum(resultData.registerNum)}}</div>
                                        <div class="foot-btn">
                                            <span class="detail-btn">查看详情</span>
                                            <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                        </div>
                                    </a>
                                </div>

                                <h5 class="widget-title lighter">
                                    <i class="ace-icon fa fa-bookmark"></i>
                                    网上订货
                                </h5>
                                <div class="row" style="margin-bottom:20px;margin-left: 26px;">
                                    <shiro:hasPermission name="CLOUDERPORDERSPLORDER:STATISTICS">

                                        <a class="my-btn"
                                           href="${contextPath}/page/orderDataStatistics" target="_blank"
                                           style="background: rgba(255, 184, 72, 1.0);">
                                            <div class="head-btn">订烟户数</div>
                                            <div class="body-btn">{{formatNum(resultData.dingYanNum)}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>

                                        <a class="my-btn"
                                           href="${contextPath}/page/orderDataStatistics" target="_blank"
                                           style="background: rgba(65, 81, 202, 1.0);">
                                            <div class="head-btn">订货数量</div>
                                            <div class="body-btn">{{formatNum(resultData.orderQty/250)}}箱</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>

                                        <a class="my-btn"
                                           href="${contextPath}/page/orderDataStatistics" target="_blank"
                                           style="background: rgba(227, 181, 39, 1.0);">
                                            <div class="head-btn">订货比例</div>
                                            <div class="body-btn">
                                                {{formatNum(resultData.dingYanNum/resultData.registerNum*100)}}%
                                            </div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                    </shiro:hasPermission>
                                    <shiro:lacksPermission name="CLOUDERPORDERSPLORDER:STATISTICS">
                                        <a class="my-btn"
                                           style="background: rgba(255, 184, 72, 1.0);">
                                            <div class="head-btn">订烟户数</div>
                                            <div class="body-btn">{{formatNum(resultData.dingYanNum)}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>

                                        <a class="my-btn"
                                           style="background: rgba(65, 81, 202, 1.0);">
                                            <div class="head-btn">订货数量</div>
                                            <div class="body-btn">{{formatNum(resultData.orderQty/250)}}箱</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>

                                        <a class="my-btn"
                                           style="background: rgba(227, 181, 39, 1.0);">
                                            <div class="head-btn">订货比例</div>
                                            <div class="body-btn">
                                                {{formatNum(resultData.dingYanNum/resultData.registerNum*100)}}%
                                            </div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                    </shiro:lacksPermission>
                                </div>


                                <h5 class="widget-title lighter">
                                    <i class="ace-icon fa fa-bullhorn"></i>
                                    网上营销
                                </h5>
                                <div class="row" style="margin-bottom:20px;margin-left: 26px;">

                                    <a class="my-btn"
                                            <shiro:hasPermission name="CLOUDERPSHOP:VIEW">
                                                href="${contextPath}/sys/user/home#page/clouderpShopAudit" target="_blank"
                                            </shiro:hasPermission>
                                       style="background: rgba(133, 43, 153, 1.0);">
                                        <div class="head-btn">试点店铺</div>
                                        <div class="body-btn">{{formatNum(resultData.expNum)}}</div>
                                        <div class="foot-btn">
                                            <span class="detail-btn">查看详情</span>
                                            <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                        </div>
                                    </a>


                                    <a class="my-btn"
                                            <shiro:hasPermission name="STOCK:STATISTICS">
                                                href="${contextPath}/page/stock" target="_blank"
                                            </shiro:hasPermission>
                                       style="background: rgba(224, 96, 51, 1.0);">
                                        <div class="head-btn">库存数量</div>
                                        <div class="body-btn">{{formatNum(resultData.stockNum/250)}}箱</div>
                                        <div class="foot-btn">
                                            <span class="detail-btn">查看详情</span>
                                            <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                        </div>
                                    </a>
                                </div>

                                <h5 class="widget-title lighter">
                                    <i class="ace-icon fa fa-glass"></i>
                                    网上结算
                                </h5>
                                <div class="row" style="margin-bottom:20px;margin-left: 26px;">
                                    <shiro:hasPermission name="CLOUDERPORDERSPLORDER:STATISTICS">
                                        <a class="my-btn"
                                           href="${contextPath}/page/orderDataStatistics" target="_blank"
                                           style="background: rgba(40, 183, 121, 1.0);">
                                            <div class="head-btn">绑卡总数</div>
                                            <div class="body-btn">{{formatNum(resultData.bindCarNum)}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                        <a class="my-btn"
                                           href="${contextPath}/page/orderDataStatistics" target="_blank"
                                           style="background: rgba(255, 137, 72, 1.0);">
                                            <div class="head-btn">支付户数</div>
                                            <div class="body-btn">{{formatNum(resultData.payNum)}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                        <a class="my-btn"
                                           href="${contextPath}/page/splOrderStatisticsView" target="_blank"
                                           style="background: rgba(241, 82, 194, 1.0);">
                                            <div class="head-btn">支付笔数</div>
                                            <div class="body-btn">{{formatNum(resultData.payCountNum)}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                        <a class="my-btn"
                                           href="${contextPath}/page/splOrderStatisticsView" target="_blank"
                                           style="background: rgba(97, 69, 240, 1.0);">
                                            <div class="head-btn">支付金额</div>
                                            <div class="body-btn">{{managerPayAmt}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                        <a class="my-btn"
                                           href="${contextPath}/page/orderDataStatistics" target="_blank"
                                           style="background: rgba(36, 188, 202, 1.0);">
                                            <div class="head-btn">支付比例</div>
                                            <div class="body-btn">
                                                {{formatNum(resultData.payNum/resultData.bindCarNum*100)}}%
                                            </div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                    </shiro:hasPermission>
                                    <shiro:lacksPermission name="CLOUDERPORDERSPLORDER:STATISTICS">
                                        <a class="my-btn"
                                           style="background: rgba(40, 183, 121, 1.0);">
                                            <div class="head-btn">绑卡总数</div>
                                            <div class="body-btn">{{formatNum(resultData.bindCarNum)}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                        <a class="my-btn"
                                           style="background: rgba(255, 137, 72, 1.0);">
                                            <div class="head-btn">支付户数</div>
                                            <div class="body-btn">{{formatNum(resultData.payNum)}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                        <a class="my-btn"
                                           style="background: rgba(241, 82, 194, 1.0);">
                                            <div class="head-btn">支付笔数</div>
                                            <div class="body-btn">{{formatNum(resultData.payCountNum)}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                        <a class="my-btn"
                                           style="background: rgba(97, 69, 240, 1.0);">
                                            <div class="head-btn">支付金额</div>
                                            <div class="body-btn">{{managerPayAmt}}</div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                        <a class="my-btn"
                                           style="background: rgba(36, 188, 202, 1.0);">
                                            <div class="head-btn">支付比例</div>
                                            <div class="body-btn">
                                                {{formatNum(resultData.payNum/resultData.bindCarNum*100)}}%
                                            </div>
                                            <div class="foot-btn">
                                                <span class="detail-btn">查看详情</span>
                                                <span class="detail-click">
					                                    <i class="glyphicon glyphicon-circle-arrow-right"></i>
				                                    </span>
                                            </div>
                                        </a>
                                    </shiro:lacksPermission>
                                </div>
                            </div>
                        </div><!-- /.widget-body -->
                    </div>
                </div>
            </div>
        </shiro:hasPermission>

        <div class="row" style="margin-top: 30px;">
            <shiro:hasPermission name="STATISTICS:LIST">

                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div class="widget-box transparent">
                        <div class="widget-header widget-header-flat">
                            <h4 class="widget-title lighter">
                                <i class="ace-icon fa fa-bar-chart-o"></i>
                                实时监控
                            </h4>

                            <div class="widget-toolbar">
                                <a href="#" data-action="collapse">
                                    <i class="ace-icon fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>

                        <div class="widget-body">
                            <div class="widget-main padding-4">
                                <shiro:hasPermission name="CLOUDERPORDERSPLORDER:STATISTICS">
                                    <a href="${contextPath}/page/orderDataStatistics" target="_blank"
                                       class="btn btn-app btn-success no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-fire bigger-230"></i>
                                        烟草订单
                                    </a>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="SHIPMENTORDERDATA:STATISTICS">
                                    <a href="${contextPath}/page/shipmentOrderDataStatistics" target="_blank"
                                       class="btn btn-app btn-info no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-barcode bigger-230"></i>
                                        扫码出货
                                    </a>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="SCRATCHOFF:STATISTICS">
                                    <a href="${contextPath}/page/scratchoff" target="_blank" class=" btn btn-app btn-grey
                                       no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-thumbs-up bigger-230"></i>
                                        物料投放
                                    </a>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="DAZHUANPAN_PRIZE:STATISTICS">
                                    <a href="${contextPath}/page/daZhuanPanPrize" target="_blank" class=" btn btn-app btn-warning
                                       no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-empire bigger-230"></i>
                                        抽奖活动
                                    </a>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="STOCK:STATISTICS">
                                    <a href="${contextPath}/page/stock" target="_blank"
                                       class="btn btn-app btn-purple no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-skyatlas bigger-230"></i>
                                        库存统计
                                    </a>
                                </shiro:hasPermission>
                            </div><!-- /.widget-body -->
                        </div><!-- /.widget-box -->
                    </div>
                </div>
            </shiro:hasPermission>
            <shiro:hasPermission name="SOMKER_CUSTOMER:ROOT">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div class="widget-box transparent">
                        <div class="widget-header widget-header-flat">
                            <h4 class="widget-title lighter">
                                <i class="ace-icon fa fa-line-chart"></i>
                                卷烟消费
                            </h4>

                            <div class="widget-toolbar">
                                <a href="#" data-action="collapse">
                                    <i class="ace-icon fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>

                        <div class="widget-body">
                            <div class="widget-main padding-4">
                                <shiro:hasPermission name="SOMKER_CUSTOMER:LIST">
                                    <a href="${contextPath}/checking/toSmokeCustomerStatisticsListPage" target="_blank"
                                       class="btn btn-app btn-warning no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-users bigger-230"></i>
                                        消费记录分析
                                    </a>
                                    <a href="${contextPath}/checking/toSmokeCustomerPage" target="_blank"
                                       class="btn btn-app btn-primary no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-users bigger-230"></i>
                                        购买变化分析
                                    </a>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="SOMKER_CUSTOMER:STATISTICS">
                                    <a href="${contextPath}/checking/toSmokeCustomerStatistics" target="_blank"
                                       class="btn btn-app btn-default no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-area-chart bigger-230"></i>
                                        单品分析
                                    </a>
                                    <a href="${contextPath}/checking/toCustomerSmokeStatistics" target="_blank"
                                       class="btn btn-app btn-info no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-area-chart bigger-230"></i>
                                        零售户统计
                                    </a>
                                    <a href="${contextPath}/shop/toSmokeShopStatistics" target="_blank"
                                       class="btn btn-app btn-success no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-area-chart bigger-230"></i>
                                        卷烟销售统计
                                    </a>
                                </shiro:hasPermission>
                            </div><!-- /.widget-main -->
                        </div><!-- /.widget-body -->
                    </div><!-- /.widget-box -->
                </div>
            </shiro:hasPermission>
            <shiro:hasPermission name="CHECKING:ROOT_">
                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                    <div class="widget-box transparent">
                        <div class="widget-header widget-header-flat">
                            <h4 class="widget-title lighter">
                                <i class="ace-icon fa fa-calculator"></i>
                                对账管理
                            </h4>

                            <div class="widget-toolbar">
                                <a href="#" data-action="collapse">
                                    <i class="ace-icon fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>

                        <div class="widget-body">
                            <div class="widget-main padding-4">
                                <a href="${contextPath}/checking/generalLedgerPage" target="_blank"
                                   class="btn btn-app btn-pink no-radius"
                                   style="width: 156px;height: 92px;">
                                    <i class="ace-icon fa fa-list bigger-230"></i>
                                    总账查询
                                </a>
                                <a href="${contextPath}/checking/checkingDetailPage" target="_blank"
                                   class="btn btn-app btn-warning no-radius"
                                   style="width: 156px;height: 92px;">
                                    <i class="ace-icon fa fa-list-alt bigger-230"></i>
                                    明细查询
                                </a>
                                <shiro:hasPermission name="CLEARING:DO_CLEARING">
                                    <a href="${contextPath}/clearing/clearingOrderPage" target="_blank"
                                       class="btn btn-app btn-danger no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-list-alt bigger-230"></i>
                                        订单清算
                                    </a>
                                </shiro:hasPermission>
                            </div><!-- /.widget-main -->
                        </div><!-- /.widget-body -->
                    </div><!-- /.widget-box -->
                </div>
            </shiro:hasPermission>
        </div><!-- /.col -->


        <div class="row" style="margin-top: 30px;">
            <shiro:hasPermission name="CHECKING:ROOT">
                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                    <div class="widget-box transparent">
                        <div class="widget-header widget-header-flat">
                            <h4 class="widget-title lighter">
                                <i class="ace-icon fa fa-calculator"></i>
                                对账管理
                            </h4>

                            <div class="widget-toolbar">
                                <a href="#" data-action="collapse">
                                    <i class="ace-icon fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>

                        <div class="widget-body">
                            <div class="widget-main padding-4">
                                <a href="${contextPath}/checking/generalLedgerPage" target="_blank"
                                   class="btn btn-app btn-pink no-radius"
                                   style="width: 156px;height: 92px;">
                                    <i class="ace-icon fa fa-list bigger-230"></i>
                                    总账查询
                                </a>
                                <a href="${contextPath}/checking/checkingDetailPage" target="_blank"
                                   class="btn btn-app btn-warning no-radius"
                                   style="width: 156px;height: 92px;">
                                    <i class="ace-icon fa fa-list-alt bigger-230"></i>
                                    明细查询
                                </a>
                                <shiro:hasPermission name="CLEARING:DO_CLEARING">
                                    <a href="${contextPath}/clearing/clearingOrderPage" target="_blank"
                                       class="btn btn-app btn-danger no-radius"
                                       style="width: 156px;height: 92px;">
                                        <i class="ace-icon fa fa-list-alt bigger-230"></i>
                                        订单清算
                                    </a>
                                </shiro:hasPermission>
                            </div><!-- /.widget-main -->
                        </div><!-- /.widget-body -->
                    </div><!-- /.widget-box -->
                </div>
            </shiro:hasPermission>
        </div><!-- /.col -->

        <!-- 数据统计 -->
        <div class="row" style="margin-top: 30px;">
            <shiro:hasPermission name="SHUJUTONGJI:ROOT">
                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                    <div class="widget-box transparent">
                        <div class="widget-header widget-header-flat">
                            <h4 class="widget-title lighter">
                                <i class="ace-icon fa fa-calculator"></i>
                                数据统计
                            </h4>

                            <div class="widget-toolbar">
                                <a href="#" data-action="collapse">
                                    <i class="ace-icon fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>

                        <div class="widget-body">
                            <div class="widget-main padding-4">
                                <a href="${contextPath}/count/scanCode" target="_blank"
                                   class="btn btn-app btn-pink no-radius"
                                   style="width: 156px;height: 92px;">
                                    <i class="ace-icon fa fa-list bigger-230"></i>
                                    扫码出货汇总查询
                                </a>
                                <a href="${contextPath}/count/order" target="_blank"
                                   class="btn btn-app btn-warning no-radius"
                                   style="width: 156px;height: 92px;">
                                    <i class="ace-icon fa fa-list-alt bigger-230"></i>
                                    订单结算情况统计
                                </a>
                                <a href="${contextPath}/count/recommendOrde" target="_blank"
                                   class="btn btn-app btn-warning no-radius"
                                   style="width: 156px;height: 92px;">
                                    <i class="ace-icon fa fa-list-alt bigger-230"></i>
                                    推荐订单总汇
                                </a>
                                <a href="${contextPath}/count/tobaccoOrde" target="_blank"
                                   class="btn btn-app btn-warning no-radius"
                                   style="width: 156px;height: 92px;">
                                    <i class="ace-icon fa fa-list-alt bigger-230"></i>
                                    烟草订单数据
                                </a>
                            </div><!-- /.widget-main -->
                        </div><!-- /.widget-body -->

                    </div><!-- /.widget-box -->
                </div>
            </shiro:hasPermission>
        </div><!-- /.col -->

    </div>
</div>
<!-- /.row -->

<!-- page specific plugin scripts -->
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.min.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.fr.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${contextPath}/static/statistics/js/vue.js"></script>
<script type="text/javascript" src="${contextPath}/static/statistics/js/jquery.mockjax.js"></script>
<script type="text/javascript" src="${contextPath}/static/statistics/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="${contextPath}/static/util/my-autocomplete.js"></script>
<script src=${contextPath}/static/layer/layer.js></script>

<script type="text/javascript">

    var app = new Vue({
        el: '#app',
        data: {
            queryModel: {
                stringMap: {}
            },
            resultData: {
                registerNum: "0",
                bindCarNum: "0",
                expNum: "0",
                dingYanNum: "0",
                payNum: "0",
                payCountNum: "0",
                payAmt: "0",
                orderQty: "0",
                stockNum: "0",
            }

        },
        computed: {
            managerPayAmt: function () {
                var payAmt = this.resultData.payAmt;
                if (!payAmt) {
                    return '0元';
                }
                if (payAmt > 100000000) {
                    return (payAmt / 100000000).toFixed(2) + "亿";
                }
                if (payAmt > 10000) {
                    return (payAmt / 10000).toFixed(2) + "万";
                }
                return payAmt
            }
        },
        methods: {
            selectData: function (flag) {
                var cityName = $("#cityNameInput").val();
                var quXianName = $("#quXianNameInput").val();
                var channelName = $("#channelNameInput").val();
                var empName = $("#empNameInput").val();
                var beginTime = $("#beginTimeInput").val();
                var endTime = $("#endTimeInput").val();
                if (flag) {
                    layer.load(1)
                }
                $.ajax({
                    url: '${contextPath}/page/getSynthesisSelect',
                    type: 'post',
                    dataType: 'json',
                    data: {
                        stringMap: {
                            cityName: cityName,
                            quXianName: quXianName,
                            channelName: channelName,
                            empName: empName,
                            beginTime: beginTime,
                            endTime: endTime,
                        }
                    },
                    success: function (data) {
                        if (data.success) {
                            var result = data.data;
                            var numResult = result.numResult;
                            if (numResult) {
                                app.resultData = numResult;
                            }else {
                                app.resultData = {
                                    registerNum: "0",
                                        bindCarNum: "0",
                                        expNum: "0",
                                        dingYanNum: "0",
                                        payNum: "0",
                                        payCountNum: "0",
                                        payAmt: "0",
                                        orderQty: "0",
                                        stockNum: "0",
                                }
                            }
                        } else {
                            layer.msg(data.message);
                        }
                        layer.closeAll('loading')
                    },
                    error: function (error) {
                        layer.closeAll('loading')
                        layer.msg("网络连接失败")
                    }
                })
            },
            goCgtCustPage: function () {
                window.location.href = '${contextPath}/sys/user/home#page/clouderpClienteleTobacco'
            },
            formatNum: function (num) {
                if (!num) {
                    return '0';
                }


                if (num > 100000000) {
                    return (num / 100000000).toFixed(2) + "亿";
                }
                if (num > 10000) {
                    return (num / 10000).toFixed(2) + "万";
                }

                if (num.toString().indexOf('.') > 0) {
                    return (num * 1).toFixed(2)
                }

                return num
            },
        }

    });


    var day1 = new Date();
    day1.setTime(day1.getTime()-24*60*60*1000);

    var year = day1.getFullYear();
    var month = day1.getMonth() + 1;
    if (month < 10) {
        month = '0' + month
    }
    var date = day1.getDate();
    if (date < 10) {
        date = '0' + date
    }


    //var nowDate = new Date();
    //nowDate.setMonth(nowDate.getMonth() - 1);
    $('#beginTimeInput').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        showMeridian: 1,
        minView: 2,
        //startDate: nowDate,
        format: "yyyy-mm-dd",
    }).on('changeDate', function (e) {
        var startTime = e.date;
        $('#endTimeInput').datetimepicker('setStartDate', startTime);
    });
    $('#endTimeInput').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        showMeridian: 1,
        minView: 2,
        format: "yyyy-mm-dd",
        endDate : day1,
    }).on('changeDate', function (e) {
        var endTime = e.date;
        $('#beginTimeInput').datetimepicker('setEndDate', endTime);
    });



    var defauteBeginDate = year + '-' + month +'-' + date;
    $('#endTimeInput').val(defauteBeginDate);
    app.selectData(0);


    var exportExcel = function () {
        if (app.orderList.length <= 0) {
            layer.msg("当前表格没有数据");
            return
        }
        $("#exportExcelData").val(JSON.stringify(app.orderList))
        $("#exportExcel").submit();

    }

    function numAdd(num1, num2) {
        if (num1 == null || num1 == undefined || num1 == "") {
            return num2;
        }
        var baseNum, baseNum1, baseNum2;
        try {
            baseNum1 = num1.toString().split(".")[1].length;
        } catch (e) {
            baseNum1 = 0;
        }
        try {
            baseNum2 = num2.toString().split(".")[1].length;
        } catch (e) {
            baseNum2 = 0;
        }
        baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
        var precision = (baseNum1 >= baseNum2) ? baseNum1 : baseNum2;//精度
        return ((num1 * baseNum + num2 * baseNum) / baseNum).toFixed(precision);
        ;
    };

    var formatDate = function (data) {
        if (data < 10) {
            data = "0" + data
        }
        return data
    }


    var cityNode, quXianNode, channelNode, empNode, custNode, shopNode = null;

    <shiro:lacksPermission name="CLOUDERPORDERSPLEMPORDER:STATISTICS">
    empNode = '#empNameInput';
    channelNode = '#channelNameInput';
    <shiro:hasPermission name="CLOUDERPORDERSPLADMINORDER:STATISTICS">
    cityNode = '#cityNameInput';
    quXianNode = '#quXianNameInput';
    </shiro:hasPermission>
    </shiro:lacksPermission>

    organization_tree('${contextPath}', cityNode, quXianNode, channelNode, empNode, custNode, shopNode);


    $(function () {
        $('[data-toggle="tooltip"]').tooltip()
    });

</script>
    